<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- - 里面现存有  100 块钱。  var money = 100

- 如果存钱，就用输入钱数加上先存的钱数, 之后弹出显示余额提示框. Money. = Money + 10

- 如果取钱，就减去取的钱数，之后弹出显示余额提示框. money = money - 19

- 如果显示余额，就输出余额. Money

- 如果退出，弹出退出信息提示框. Alert

  操作界面如下 -->
  <script>
    var money = 100, tip = '请选择操作 \n 1. 存钱 \n 2. 取钱 \n 3. 查看余额 \n 4. 退出 \n', mark = true
   
    do {
      var flag = parseInt(prompt(tip))
      switch (flag) {
        case 1:
          var dough = parseInt(prompt('请输入存的钱'))
          money = money + dough
          alert('你有' + money + '钱')
          break
        case 2:
          var dough = parseInt(prompt('请输入取的钱'))
          money = money - dough
          alert('你有' + money + '钱')
          break
        case 3:
          alert('你有' + money + '钱')
          break
        case 4:
          mark = false
      }
    } while (mark)

  </script>
</body>

</html>